/*
 * @Author: zzy zhangzeyang@huidr.com
 * @Date: 2024-11-15 18:21:05
 * @LastEditors: zzy zhangzeyang@huidr.com
 * @LastEditTime: 2024-11-18 16:14:26
 * @FilePath: \about_vue\src\netword.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from 'axios';

const api=axios.create({
    baseURL:"https://gateway.huidr.com",
    headers:{
        'Content-Type':'application/json'
    },
});


api.interceptors.response.use(response=>{
    const res=response.data;
    // console.log('intercept',res);
    // console.log('intercept',response);
    if(response.status==200){
        return response.data;
    }else{
        return Promise.reject(res);
    }
},error=>{
    return Promise.reject(error);
})

export default api;
// const instance=axios.create({
//     baseURL:"https://gateway.huidr.com",
//     timeout:1000,
//     // headers:{}
// })
// instance.interceptors.request.use(config=>{

// });

